from omegaconf.errors import ValidationError

class ZS_ValidationError(ValidationError):
    def __init__(self, verr=None, msg=None, path=None):
        if verr is None:
            self.msg = msg
            path = [] if (path is None) else path
            self.full_key = '.'.join(path)
        else:
            self.msg = verr.msg.split('\n')[0]
            self.full_key = verr.full_key

    def __str__(self):
        return f'Invalid option \"{self.full_key}\":\n{self.msg}'

